package com.itheima.config;

import com.itheima.properties.JwtProperties;
import com.itheima.utils.JwtUtils;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(JwtProperties.class)
public class JwtsConfiguration {

    @Bean
    public JwtUtils jwtUtils(JwtProperties jwtProperties) {
        return new JwtUtils(jwtProperties.getUserSecretKey(), jwtProperties.getUserTtl());
    }
}
